import { FormGroup, FormBuilder } from '@angular/forms';
import { OnInit } from '@angular/core';

/**
 * 画面追加
 */
export abstract class ScreenEditParentComponent implements OnInit {

  form: FormGroup;

  constructor(protected formBuilder: FormBuilder) {}

  ngOnInit(): void {
    this.form = this.formBuilder.group({
      screenCode:[null,[]],
      screenName:[null,[]],
    });
  }

  /**
   * 添加
   */
  on${stringutils.capitalize($component.code)}(event) {
    this.do${stringutils.capitalize($component.code)}(event);
  }

  protected abstract do${stringutils.capitalize($component.code)}(event);
  /**
   * 删除
   */
  on${stringutils.capitalize($component.code)}(event) {
    this.do${stringutils.capitalize($component.code)}(event);
  }

  protected abstract do${stringutils.capitalize($component.code)}(event);
  /**
   * 保存
   */
  onSave(event) {
    this.doSave(event);
  }

  protected abstract doSave(event);
  /**
   * 取消
   */
  onCancel(event) {
    this.doCancel(event);
  }

  protected abstract doCancel(event);

}